home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-06-03 | 3.2 KB | 71 lines | [TEXT/KAHL] |
- //-------------------------------------------------------------------------------------
- // File : TogLib.h
- // Purpose : Function prototyes for "Tog button" support routines
- // Author : Jim Stout
- // Date : November 2, 1991
- //-------------------------------------------------------------------------------------
-
- #define TOGUP -1
- #define TOGDOWN 1
-
- //-------------------------------------------------------------------------------------
- // Call initTogButtons before calling ModalDialog.
- //
- // Call it once for each group of "Tog Buttons" in the dialog.
- //
- // This function initializes the "goUP" flag (stored in the
- // refCon of the first control. It will be "up" unless the
- // first control is ON, then it is "down". If no controls
- // are ON, it will turn on the first control.
- //-------------------------------------------------------------------------------------
- void initTogButtons(
- DialogPtr theDialog, // pretty obvious, the dialog with the buttons
- short first, // the DITL item for button 1
- short last); // the DITL item for the last button
-
- //-------------------------------------------------------------------------------------
-
- //-------------------------------------------------------------------------------------
- // Call setTogButtons when the user clicks on a "Tog Button".
- //
- // Call it once for a click on one button in a group of
- // "Tog Buttons" in the dialog.
- //
- // This is the key routine. It will "do the right" thing for
- // a "Tog Button" - turn it ON, OFF or make it jump to the
- // next button - depending on the state of the other buttons
- // in the group. It also maintains the "goUP" flag.
- //-------------------------------------------------------------------------------------
- void setTogButtons(
- DialogPtr theDialog, // pretty obvious, the dialog with the buttons
- short itemHit, // user clicked on this item.
- short first, // the DITL item for button 1
- short last); // the DITL item for the last button
-
- //-------------------------------------------------------------------------------------
-
- //-------------------------------------------------------------------------------------
- // Call resetTogButtons whenever something that is NOT a "Tog Button" is clicked.
- //
- // This simply resets the "goUP" flag to the "up" direction.
- //-------------------------------------------------------------------------------------
- void resetTogButtons(
- DialogPtr theDialog, // pretty obvious, the dialog with the buttons
- short first); // the DITL item for button 1
-
- //-------------------------------------------------------------------------------------
-
- //-------------------------------------------------------------------------------------
- // Call setRadioButtons when the user clicks on a radio button.
- //
- // Call it once for a click on any button in a sequentially numbered
- // group of radio buttons in the dialog.
- //-------------------------------------------------------------------------------------
- void setRadioButtons(
- DialogPtr theDialog, // pretty obvious, the dialog with the buttons
- short itemHit, // user clicked on this item.
- short first, // the DITL item for button 1
- short last); // the DITL item for the last button
-
- //-------------------------------------------------------------------------------------
-